<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../jquery-1.11.2.min.js"></script>
</head>
<body>
<h2>去掉重复的select</h2>
<select  id="selectTest">
    <option>1</option>
    <option>1</option>
    <option>2</option>
    <option>2</option>
    <option>3</option>
</select>
<input id="btndel" type="button" value="删除重复项">
<script>
    $(function(){
        $("#btndel").click(function() {
            $("#selectTest option").each(function() {   /*作用：遍历select option */
                var getText = $(this).text();
                if($("#selectTest option:contains("+getText+")").length > 1)   /*作用：select option:contains("+text+")")包含text的个数 */
                {
                    $("#selectTest option:contains("+getText+"):gt(0)").remove();  /*作用：包含text大于个数0的选项就移除*/
                }
            });
        });
    });
</script>
</body>
</html>